1. Field of the Invention
The present invention is directed to computer systems; and more particularly, it is directed to utilization of graphics processors associated with computer systems for rendering transparency groups.
2. Description of the Related Art
As the power and complexity of personal computer systems increase, graphics operations and graphical data are likewise increasing in complexity. Graphical data, particularly two-dimensional graphical data, may typically be expressed in a structured format that complies with a particular specification or model for representing such data. Such imaging models may often be implemented across multiple computing platforms to facilitate the exchange of graphical data.
One such specification, the Adobe Portable Document Format (PDF), is the native file format of the Adobe® Acrobat® family of products. By using products that implement the PDF format, users may exchange and view electronic documents in a manner that is substantially independent of the environment in which the documents were created. PDF includes an imaging model that describes text and graphics in a device-independent and resolution-independent manner. The PDF imaging model includes various structures to describe complex two-dimensional graphical data including geometric models and bitmapped images.
The Scalable Vector Graphics (SVG) specification is another model for representing two-dimensional graphical data. SVG includes a modularized XML language for describing two-dimensional graphics and an application programming interface (API) usable for building graphical applications. The World Wide Web
Consortium (W3C), a forum for developing interoperable web-based technologies, promulgates the SVG model.
Both the PDF and SVG specifications provide for various types of transparency or alpha compositing in two-dimensional graphics. For example, the PDF specification includes transparency groups. A transparency group includes a sequence of consecutive objects in a transparency stack. The objects may be collected together and composited to produce a single color, shape, and opacity at each point. The result may be treated as if it were a single object for subsequent compositing. In the PDF model, the group may be classified as a knockout group. Similarly, the SVG model provides for complex groups having a knockout property. In a knockout group, each individual element may be composited with the group's initial backdrop rather than with the stack of preceding elements in the group. For objects with binary shapes (e.g., a shape alpha of 1.0 for inside and 0.0 for outside), each object may overwrite (or “knock out”) the effect of earlier-drawn (i.e., underlying) elements that it overlaps within the same group. At any given point, only the topmost object enclosing the point contributes to the final color and opacity of the group as a whole. Knockout groups may be useful in composing a piece of artwork from a collection of overlapping objects wherein the topmost object completely obscures objects underneath while interacting with the group's backdrop in a usual manner.
With the PDF specification, an object may have two different alpha properties: opacity alpha and shape alpha. The opacity alpha property defines the opaqueness of the object's color. The shape alpha property defines to what degree the object knocks out earlier-drawn objects in the knockout group.
Prior approaches to rendering knockout groups have been implemented with a CPU and main memory of a computer system. For example, a special frame buffer is allocated that contains an extra alpha channel. The extra alpha channel is used to store the shape alpha for objects in the knockout group. Therefore, the frame buffer for a knockout group may have five channels: red (R), green (G), blue (B), opacity alpha (A), and an extra alpha channel for shape alpha (A2). Objects within a knockout group are drawn from back to front. As each object in the knockout group is drawn, all five channels of the object and all five channels of the previously drawn objects (as stored in the frame buffer) are used to calculate the final color at any given point. The shape alpha property of the object determines how much the object knocks out the previously drawn objects.